package cn.bellychang.deferredresult;

import cn.bellychang.db1.model.Synonym;
import cn.bellychang.db1.repository.SynonymRepository;
import cn.bellychang.db2.model.CoreItemHitNumView;
import cn.bellychang.db2.service.CoreItemHitNumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ChangLiang
 * @date 2020/3/31
 */
@RestController
public class EsController {

    @Autowired
    private SynonymRepository repository;

    @Autowired
    private CoreItemHitNumService coreItemHitNumService;

    @GetMapping("suggest")
    public List<CoreItemHitNumView>  ListNohitSuggest() {
        List<CoreItemHitNumView> value = coreItemHitNumService.ListNohitSuggest();
        return value;
    }

    @GetMapping("synonym")
    public List<Synonym>  ListSynonym() {
        List<Synonym> all = repository.findAll();
        return all;
    }
}
